package main

import (
	"fmt"
	"time"
)

func process() {
	defer trace("process")()
	time.Sleep(5 * time.Second)
}

func trace(s string) func() {
	start := time.Now()
	fmt.Printf("%s start\n", s)
	return func() {
		fmt.Printf("%s end. elapse:%s\n", s, time.Since(start))
	}
}

func main() {
	process()
}
